<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%--通用的菜单 --%>
<div class="panel panel-primary">
	<div class="panel-heading">
        <strong>
            <span class="glyphicon glyphicon-list"></span> 菜单
        </strong>
    </div>
    <div class="panel-body" style="padding:5px">
    
        <div class="panel panel-success">
    		<div class="panel-heading">
    			<strong> <span class="glyphicon glyphicon-list"></span> 其他功能模块  </strong>
		    </div>
		    <div class="panel-body">
    			 <ul class="nav side-nav">
			        <li ><a href="index.action"><span class="glyphicon "></span> 首页</a></li>
			        <li > <a href="" ><span class="glyphicon "></span> 代码生成管理</a>
			        	<ul class="nav">
				        	<li ><a href="views/genCode/form1.jsp"><span class="glyphicon "></span>代码生成管理(单表)</a></li>
					    </ul>
			        </li>
			     </ul>	
		    </div>
	    </div>
	    <div class="panel panel-success">
    		<div class="panel-heading">
    			<strong> <span class="glyphicon glyphicon-list"></span> 自动生成模块  </strong>
		    </div>
		    <div class="panel-body" style="padding:5px">
    			<div class="list-group">
			   		 <c:forEach items="${listModule}" var="module">
				        <a class="list-group-item"  href="${module.queryUrl}"><span class="glyphicon "></span>${module.moduleInfo}管理</a>
				    </c:forEach>
			    </div>
		    </div>
	    </div>
    </div>
    <script type="text/javascript" >
    	/**
    	设置点击选中的状态
    	*/
    	function setSelectedMenu(){
    		$("a.list-group-item").on('click',function(){
        		//获取选中a标签的标识
        		var href=$(this).attr('href');
        		//把选中的标识放入cookie
        		Cookie.setCookie('selectedAItemHref',href);
        	});
        	var selectedAItemHref=  Cookie.getCookie('selectedAItemHref');
        	if(selectedAItemHref){
        		//读取当前选中的标识设置选中状态
            	$("a.list-group-item[href='"+selectedAItemHref+"']").addClass("active");
        	}
    	}
    	setSelectedMenu();
    </script>
</div>